<ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
</ul>
<script>
    // ...
    // ...数据(数组|对象)  展开数组或对象

    let arr=[1,2,3,4,5,[7,8]]
    console.log(...arr);
    console.log(1,2,3,4,5);
    // ...arr ==>  1,2,3,4,5

    // 实现浅拷贝
    let copyarr=[...arr]
    copyarr.push(6)
    arr[5].push(9)
    console.log(arr,111111111);
    console.log(copyarr,222222222);




    // 把伪数组转为真正的数组
    let oli=document.getElementsByTagName("li")
    console.log(oli);
    console.log(...oli);
    console.log([...oli]);


    // 合并数组
    let arr1=["a","b","c"];
    let arr2=["d","e","f"];
    // ...arr1 ==> "a","b","c"
    // ...arr2 ==> "d","e","f"
    let arr3=[...arr1,...arr2 ]
    console.log(arr3);//['a', 'b', 'c', 'd', 'e', 'f']


    // 合并对象
    let obj1={
        name1:"zs"
    }
    let obj2={
        age:18
    }
    // ...obj1 ==> name1:"zs"
    // ...obj2 ==> age:18
    let obj3={
        ...obj1,
        ...obj2
    }
    console.log(obj3);//{name1: 'zs', age: 18}

  

    // 将数组当作实参进行传递
    let newarr=[1,2,3]
    function fun(x,y,z){
        console.log(x,y,z);
    }
    fun(newarr[0],newarr[1],newarr[2])
    // fun(1,2,3)
    fun(...newarr)






</script>